﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<BlogPlat.Model.Post>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Admin Posts - BlogPlat.NET - .NET Blogging Platform
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Blog Posts</h2>

    <table width="1000" cellspacing="1">
        <tr>
            <td colspan="7" class="createtd">
                <%: Html.ActionLink("Create New", "create") %>
            </td>
        </tr>

        <tr>
            <th></th>  
            <th></th>         
            <th>
                Author
            </th>
            <th>
                PostTitle
            </th>                     
            <th>
                DatePublished
            </th>
            <th>
                Published
            </th>
            <th>
                Viewed
            </th>            
        </tr>
        
    <% 
        int row = 1;
        foreach (var item in Model) { 
            if(row % 2 == 0) { %>                    
                <tr class="even">
                    <% Html.RenderPartial("PostListItem", item); %>       
                </tr>
            <% } else { %>
                <tr>
                    <% Html.RenderPartial("PostListItem", item); %>       
                </tr>        
            <% }
               row++;
        } %>    
    </table>       

</asp:Content>